<? include 'server_config.php'; 

if($_SESSION['user_idx'] == "")
{
	?>
	<script>
		location.href='login.php';
	</script>
	<?
	return;
}


?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
	<title> New Document </title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="Stylesheet" type="text/css" href="./css/nddCommon.css" />
	<script type="text/javascript" src="./js/jquery-1.6.2.min.js"></script>

</head>

 <body>
	<div id='wrapper'>
		<?
        include "top_menu.php";
        ?>
		
		<div id='left_bg'>
		</div>


		<div id='title'>
			<div id='title_margin_top'><span></span></div>
			<div style='width:195px;height:29px;float:left;'></div>
			<div style='width:41px;height:29px;float:left;'><img src="./img/top_icon_input.png"></div><div style='height:29px;float:left;margin-top:3px;'><span id='article_content' >방문하신 병원을 평가해 주세요</span></div>
		</div>
		
		<?
		$current_file = basename(__FILE__);
		include 'side_menu_input.php';
		?>


		<div id='middle_bg'>
		</div>

		<div id='document_content' style="width:776px;float:left;">
			<div style='height:2px;width:100%;background:#cccccc;float:left;'><span><span></div>
			<div style='height:3px;width:100%;float:left;'><span><span></div>
			
			<form name="fwrite" action="hospital_process_proc.php"  method="post" enctype="multipart/form-data"  id="fwrite">

			<div style="width:714px;background:#F2F2F2;float:left;border:1px solid #E9E9E9;padding:30px;">
				<div style="width:30px;height:30px;float:left;"></div>
				<div style="width:600px;float:left;">
					방문병원<br/><br/>
					<?

						$id = $_GET['id'];

						$sql = "
							SELECT name, address, phone FROM ndd_hospital WHERE hospital_idx = $id LIMIT 1
						";

						$result = mysql_query($sql,$connect);

						$row = mysql_fetch_row($result);

						$hospital_name=$row[0];

						?>
							<span class="name"><? echo $row[0]; ?></span>
							(
							<span class="address"><? echo $row[1]; ?></span>
							,
							<span class="phone"><? echo $row[2]; ?></span>
							)
						<?
					?> - 
					<a href='hospital_input.php'>다시 검색</a>
					<br/>
					<input type='hidden' value='<?=$id?>' name='hospital_idx'>
				</div>


				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;"></div>
				<div style="width:600px;float:left;">
					'<?=$hospital_name?>'에서 받은 치료 또는 검사를 선택하세요<br/><br/>
					<div style="width:100%;height:5px;float:left;"><span></span></div>
		<?

						$sql ="

							SELECT A.list_drug_idx, B.ProductNameKr, A.start_date, A.dosage_count, A.dosage_period, A.dosage_fq, A.dosage_period_type
							FROM ndd_drug A, ndd_list_drug B
							WHERE A.user_idx = $user_idx
								AND A.list_drug_idx = B.list_drug_idx
							ORDER BY A.start_date DESC;
							";

						$result = mysql_query($sql,$connect);

						while($row = mysql_fetch_row($result))
						{
							$drug_idx = $row[0];
							$name = $row[1];
							$start_date = $row[2];
							$dosage_count = $row[3];
							$dosage_fq = $row[5];
							$dosage_period_type = $row[6];

		?>

					<div style='width:100%;float:left;'>
						<input type='checkbox' name='drug[]' value='<?=$drug_idx?>'> <?=$name?> (<?=$start_date?>부터. <?=$dosage_fq?>)
					</div>

					<div style="width:100%;height:5px;float:left;"><span></span></div>
		<?
						
						}

						?>


		<?

						$sql ="

							SELECT A.list_test_idx, B.name, A.reg_date, A.desc, A.no_desc
							FROM ndd_test A, ndd_list_test B
							WHERE A.user_idx = $user_idx
								AND A.list_test_idx = B.list_test_idx
							ORDER BY A.reg_date DESC;
							";

						$result = mysql_query($sql,$connect);

						while($row = mysql_fetch_row($result))
						{
							$test_idx = $row[0];
							$name = $row[1];
							$reg_date = $row[2];
							$desc = $row[3];
							$no_desc = $row[4];

		?>
					<div style='width:100%;float:left;'>
						<input type='checkbox' name='test[]' value='<?=$test_idx?>'> <?=$name?> (<?=$reg_date?>)
					</div>

					<div style="width:100%;height:5px;float:left;"><span></span></div>
		<?
						
						}

						?>

					<a href='ndd_cure_drug.php'>받은 치료, 검사 추가</a>
				
				</div>



				
				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;">1</div>
				<div style="width:600px;float:left;">
					치료 및 약의 처방이 만족스러웠나요?<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="radio" name="q1" value=5>매우 만족스러움  
					<input type="radio" name="q1" value=3>괜찮았음
					<input type="radio" name="q1" value=1>만족하지 못했음
					
				
				</div>



				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;">2</div>
				<div style="width:600px;float:left;">
					의사가 병의 상태, 원인, 치료법에 대해 자세히 설명해주었나요?<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="radio" name="q2" value=5>세 가지 모두 자세히 설명
					<input type="radio" name="q2" value=3>간략한 설명, 궁금한 점 남음
					<input type="radio" name="q2" value=1>설명은 적고 치료만 받았음
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;">3</div>
				<div style="width:600px;float:left;">
					친단/치료를 받기 위해 얼마나 기다렸나요?<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="radio" name="q3" value=5>20분 이내
					<input type="radio" name="q3" value=3>20분이상 1시간 이내
					<input type="radio" name="q3" value=1>1시간 이상
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;">4</div>
				<div style="width:600px;float:left;">
					화장실, 대기실, 주차공간 등의 시설이 깨끗하고 이용하기 편했나요?<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="radio" name="q4" value=5>편하고 좋음
					<input type="radio" name="q4" value=3>보통임
					<input type="radio" name="q4" value=1>불편함을 느꼈음
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>
				<br/>

				<div style="width:30px;height:30px;float:left;">5</div>
				<div style="width:600px;float:left;">
					대중교통으로 찾아가기 쉬웠나요?<br>
					<div style="width:100%;height:5px;float:left;"><span></span></div>

					<input type="radio" name="q5" value=5>지하철/정류장 바로 앞
					<input type="radio" name="q5" value=3>10분 이내의 도보
					<input type="radio" name="q5" value=1>10분 이상 걸어야 함
					<input type="radio" name="q5" value=0>자가차량 이용
					
				
				</div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>

				<div style="width:100%;height:1px;background:gray;float:left;"><span></span></div>
				<div style="width:100%;height:2px;background:#ffffff;float:left;"><span></span></div>

				<div style="width:100%;height:15px;float:left;"><span></span></div>


				




				<div style='width:100%;height:30px;padding-left:30px;float:left;'>
						<a  onclick="value_save();" style="cursor:pointer"><img src='./img/ndd_talk_save.png' border="0"></a>&nbsp;<a style='cursor:pointer;' onclick='history.back();'><img src='./img/ndd_talk_cancel.png' border="0"></a>
						
				</div>
				



			</div>

			</form>
			<? include "footer.php";?>		
		</div>

	</div>

	<script>
			function value_save()
			{

				/*
				result_str = "q1=";
				if(q1[0].checked)
					result_str += "Y";
				else if(q1[1].checked)
					result_str += "N";
					
				result_str += "&q2="+q2.value;
				
				result_str += "&q3=";
				if(q3[0].checked)
					result_str += "Y";
				else if(q3[1].checked)
					result_str += "N";
					
				result_str += "&q4="+q4.value;
				
				result_str += "&q5=";
				if(q5[0].checked)
					result_str += "Y";
				else if(q5[1].checked)
					result_str += "N";

				result_str += "&q6=";
				if(q6[0].checked)
					result_str += "Y";
				else if(q6[1].checked)
					result_str += "N";

				result_str += "&q7=";
				if(q7[0].checked)
					result_str += "Y";
				else if(q7[1].checked)
					result_str += "N";

				result_str += "&q7_1=";
				result_str += q7_1.value;
				result_str += "&q7_2=";
				result_str += q7_2.value;

				//alert(result_str);
//				ifr_temp_status.location.href='ndd_my_info_basic_add.php?<? echo $url_args;?>&' + result_str;

*/
				fwrite.submit();


			}
	</script>
 </body>
</html>
